package com.mall.demo;


import com.mall.demo.entity.User;
import com.mall.demo.mapper.UserMapper;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

@SpringBootTest
public class Text {


    @Autowired
    private UserMapper userMapper;

    @Test
    public void getAll(){
        List<User> users = userMapper.selectList(null);
        users.forEach(System.out::println);
    }

    @Test
    public void insert(){
        User user = new User();
        user.setName("aa");
        user.setPassword("123");

        int insert = userMapper.insert(user);
        System.out.println(insert);
    }

    @Test
    public void web_insert(String n,String p,String gwc)
    {
        User user = new User();
        user.setName(n);
        user.setPassword(p);

        int insert = userMapper.insert(user);
        System.out.println(insert);
    }




}
